package com.feedback.b;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;

public class b
  implements Comparable
{
  public String a = b.class.getSimpleName();
  public a b = a.d;
  public String c;
  public d d;
  public d e;
  public List f = new ArrayList();

  public b(JSONArray paramJSONArray)
  {
    int i = 0;
    if (i >= paramJSONArray.length())
    {
      if (!(this.f.isEmpty()))
      {
        this.d = ((d)this.f.get(0));
        this.e = ((d)this.f.get(this.f.size() - 1));
        this.c = this.d.c;
        if (this.f.size() == 1)
        {
          if (((d)this.f.get(0)).g != e.b)
            break label208;
          this.b = a.b;
        }
      }
      return;
    }
    try
    {
      d locald = new d(paramJSONArray.getJSONObject(i));
      if (locald.g == e.b)
        this.b = a.c;
      this.f.add(locald);
      label208: ++i;
    }
    catch (JSONException localJSONException)
    {
      while (true)
      {
        do
          while (true)
            localJSONException.printStackTrace();
        while (((d)this.f.get(0)).g != e.a);
        this.b = a.a;
      }
    }
  }

  public int a(b paramb)
  {
    int i;
    Date localDate1 = this.e.e;
    Date localDate2 = paramb.e.e;
    if ((localDate2 == null) || (localDate1 == null) || (localDate1.equals(localDate2)))
      i = 0;
    while (true)
    {
      while (true)
      {
        return i;
        if (!(localDate1.after(localDate2)))
          break;
        i = -1;
      }
      i = 1;
    }
  }

  public d a(int paramInt)
  {
    d locald;
    if ((paramInt < 0) || (paramInt > this.f.size() - 1))
      locald = null;
    while (true)
    {
      return locald;
      locald = (d)this.f.get(paramInt);
    }
  }

  public void b(int paramInt)
  {
    if ((paramInt < 0) || (paramInt > this.f.size() - 1));
    while (true)
    {
      return;
      this.f.remove(paramInt);
    }
  }
}